import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '任务ID',
    align:"center",
    dataIndex: 'wmTaskId'
   },
   {
    title: '物料名称',
    align:"center",
    dataIndex: 'name'
   },
   {
    title: '物料编码',
    align:"center",
    dataIndex: 'code'
   },
   {
    title: '物料需求数量',
    align:"center",
    dataIndex: 'needNum'
   },
   {
    title: '物料采购数量',
    align:"center",
    dataIndex: 'purchaseNum'
   },
   {
    title: '序号',
    align:"center",
    dataIndex: 'seriesNo'
   },
   {
    title: '采购开始时间',
    align:"center",
    dataIndex: 'purchaseTime'
   },
   {
    title: '物料到货时间',
    align:"center",
    dataIndex: 'arriveTime'
   },
   {
    title: '物料领取时间',
    align:"center",
    dataIndex: 'consumeTime'
   },
   {
    title: '技改ID',
    align:"center",
    dataIndex: 'skillChangeId'
   },
   {
    title: '状态',
    align:"center",
    dataIndex: 'status_dictText'
   },
   {
    title: '租户ID',
    align:"center",
    dataIndex: 'tenantId'
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'remark'
   },
   {
    title: '删除者',
    align:"center",
    dataIndex: 'deleteBy'
   },
   {
    title: '删除时间',
    align:"center",
    dataIndex: 'deleteTime'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '任务ID',
    field: 'wmTaskId',
    component: 'Input',
  },
  {
    label: '物料名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '物料编码',
    field: 'code',
    component: 'Input',
  },
  {
    label: '物料需求数量',
    field: 'needNum',
    component: 'Input',
  },
  {
    label: '物料采购数量',
    field: 'purchaseNum',
    component: 'Input',
  },
  {
    label: '序号',
    field: 'seriesNo',
    component: 'Input',
  },
  {
    label: '采购开始时间',
    field: 'purchaseTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '物料到货时间',
    field: 'arriveTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '物料领取时间',
    field: 'consumeTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '技改ID',
    field: 'skillChangeId',
    component: 'Input',
  },
  {
    label: '状态',
    field: 'status',
    defaultValue: "PREPARE",
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"task_bom_status"
     },
  },
  {
    label: '租户ID',
    field: 'tenantId',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'remark',
    component: 'InputTextArea',
  },
  {
    label: '删除者',
    field: 'deleteBy',
    component: 'Input',
  },
  {
    label: '删除时间',
    field: 'deleteTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  wmTaskId: {title: '任务ID',order: 0,view: 'text', type: 'string',},
  name: {title: '物料名称',order: 1,view: 'text', type: 'string',},
  code: {title: '物料编码',order: 2,view: 'text', type: 'string',},
  needNum: {title: '物料需求数量',order: 3,view: 'text', type: 'string',},
  purchaseNum: {title: '物料采购数量',order: 4,view: 'text', type: 'string',},
  seriesNo: {title: '序号',order: 5,view: 'text', type: 'string',},
  purchaseTime: {title: '采购开始时间',order: 6,view: 'datetime', type: 'string',},
  arriveTime: {title: '物料到货时间',order: 7,view: 'datetime', type: 'string',},
  consumeTime: {title: '物料领取时间',order: 8,view: 'datetime', type: 'string',},
  skillChangeId: {title: '技改ID',order: 9,view: 'text', type: 'string',},
  status: {title: '状态',order: 10,view: 'list', type: 'string',dictCode: 'task_bom_status',},
  tenantId: {title: '租户ID',order: 11,view: 'text', type: 'string',},
  remark: {title: '备注',order: 12,view: 'textarea', type: 'string',},
  deleteBy: {title: '删除者',order: 13,view: 'text', type: 'string',},
  deleteTime: {title: '删除时间',order: 14,view: 'datetime', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}